<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <?php echo $this->Html->charset(); ?>
        <title>
            <?php echo $cakeDescription ?>:
            <?php echo $title_for_layout; ?>
        </title>
        <?php
        echo $this->Html->css(array('style', 'smoothness/jquery-ui-1.9.1.custom.min'));
        ?>
    </head>
    <body class="theme-Redmine controller-wiki action-show">
        <div id="top-menu">
            <div id="account">
                <?php echo $this->Html->link('Logout', '/Authusers/logout') ?>
            </div>
            <?php echo 'User Name : ' . $this->Session->read('user.name'); ?>
        </div>
        <div id="header">
            <h1>//AppName//</h1>
            <div id="main-menu">
                <ul>   
                    <?php
                    $menus_session = $this->Session->read('user.menu');
                    foreach ($menus_session as $menu_session) {
                        if ($menu == $menu_session['Authmenu']['name']) {
                            echo '<li>' . $this->Html->link($menu_session['Authmenu']['caption'], '/' . $menu_session['Authmenu']['controller'] . '/' . $menu_session['Authmenu']['action'], array('id' => 'tab-members', 'class' => 'selected')) . '</li>';
                        } else {
                            echo '<li>' . $this->Html->link($menu_session['Authmenu']['caption'], '/' . $menu_session['Authmenu']['controller'] . '/' . $menu_session['Authmenu']['action'], array('id' => 'tab-members')) . '</li>';
                        }
                    }
                    ?>                    
                </ul>
            </div>
        </div>  

        <div id="content" class="">
            <div class="tabs">
                <ul>
                    <?php
                    $menuitems_session = $this->Session->read('user.menuitem');
                    foreach ($menuitems_session as $menuitem_session) {
                        if ($menu == $menuitem_session['menu']) {
                            $listmenuitem = $menuitem_session['menuitem'];
                            foreach ($listmenuitem as $onemenuitem) {
                                if ($submenu == $onemenuitem['Authmenu']['name']) {
                                    echo '<li>' . $this->Html->link($onemenuitem['Authmenu']['caption'], '/' . $onemenuitem['Authmenu']['controller'] . '/' . $menu_session['Authmenu']['action'], array('id' => 'tab-members', 'class' => 'selected')) . '</li>';
                                } else {
                                    echo '<li>' . $this->Html->link($onemenuitem['Authmenu']['caption'], '/' . $onemenuitem['Authmenu']['controller'] . '/' . $menu_session['Authmenu']['action'], array('id' => 'tab-members')) . '</li>';
                                }
                            }
                        }
                    }
                    ?>
                </ul>
            </div>
            <div id="contenttab">
                <?php echo $this->Session->flash(); ?>
                <?php echo $this->fetch('content'); ?>
            </div>
        </div>
        <div id="footer">
            Powered by <a href="http://www.agilelang.org/">Agile Lang</a> © 2012
        </div>
    </body>
    <?php echo $this->element('sql_dump'); ?>
</body>
</html>
